package cn.wolfcode.shop.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Setter@Getter
public class Property extends BaseDomain {
    public static final Integer TYPE_INPUT= 0;//输入框
    public static final Integer TYPE_SELECT = 1;//下拉框
    private Long catalogId;
    private String name;
    private Integer sort;
    private Integer type;
    private List<PropertyValue> propertyValueList;
    public String getJsonData(){
        Map<String,Object> map = new HashMap();
        map.put("id",getId());
        map.put("catalogId",catalogId);
        map.put("name",name);
        map.put("sort",sort);
        map.put("type",type);
        return JSON.toJSONString(map);
    }
}